/*
 * @Description: 下拉选择组件
 * @Author: ZhangHan
 * @Date: 2025-05-13 08:48:05
 * @LastEditTime: 2025-07-22 15:53:15
 * @LastEditors: ZhangHan
 */
import { Select } from "antd";
import { ProSelectProps } from "./prop";

function ProSelect(props: ProSelectProps) {
  const {
    placeholder = "请选择",
    showSearch = false,
    allowClear = true,
    mode,
    callback,
    ...selectProps
  } = props;

  const handleChange = (value: any, options: any) => {
    if (callback) {
      callback(value, options);
    }
  };

  return (
    <>      
      <Select
        placeholder={placeholder}
        allowClear={allowClear}
        showSearch={showSearch}
        optionFilterProp="label"
   
        onChange={handleChange}
        {...selectProps}
             mode={mode}
      />
    </>
  );
}

export default ProSelect;
